<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var str = "中华人民共和国成立100周年";
        //charAt() 参数是 字符串的下标 
        console.log(str.charAt(5));//标准
        console.log(str[5]);

        var arr = ['a', 'b', 'c', 'd'];
        console.log(arr[3]);

        console.log(str.charCodeAt(4));
        var ss = 'a bcde';
        console.log(ss.charCodeAt(1));//空格的ascii 码 32
    </script>
</body>

</html>